package com.corecloud.mapper.mysql;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.corecloud.entity.SysUserRoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author CCW
 * @email 452050507@qq.com
 * @date 2020-08-25 18:26:28
 */
@Mapper
public interface SysUserRoleMapper extends BaseMapper<SysUserRoleEntity> {




	/**
	 * 根据权限ID更新用户与角色关联表信息
	 * @param rid
	 * @return
	 */
	@Update({"update sys_user_role sur,sys_role sr set sur.role_code = sr.`code`,sur.role_name = sr.`name`,sur.role_state = sr.is_valid ",
			"where sur.role_id = sr.id and sr.id = #{rid} "})
	Integer updateInfoByRid(Integer rid);


}
